<?php

namespace App\Game\Conf;


/**
 * 路由规则，key主要命令字=》array(子命令字对应策略类名)
 * 每条客户端对应的请求，路由到对应的逻辑处理类上处理
 * Class Route
 * @package App\Game\Conf
 */
class Route
{
    /**
     * websocket路由配置，websocke配置和tcp配置需要先去配置（MainCmd)主命令子和(SubCmdSys)子主命令字配置文件
     * @var array
     */
    public static $cmd_map = array(
        //系统请求
        MainCmd::CMD_SYS => array(
            SubCmd::HEART_ASK_REQ => 'HeartAsk',
        ),
        //游戏请求
        MainCmd::CMD_GAME => array(
            SubCmd::SUB_GAME_HALL => 'GameHall',                //游戏大厅
            SubCmd::SUB_GAME_ROOM_CREATE => 'CreateRoom',       //开房
            SubCmd::SUB_GAME_JOIN => 'JoinGame',                //进房
            SubCmd::SUB_GAME_ROOM_QUIT => 'RoomQuit',           //退出房间
            SubCmd::SUB_GAME_PREPARE => 'GamePrepare',          //游戏准备消息

            SubCmd::SUB_GAME_START_REQ => 'GameStart',          //游戏开始
            SubCmd::SUB_GAME_CHANG_CARD_REQ => 'ChangeCard',    //换牌
            SubCmd::SUB_GAME_CHOOSE_COLOR_REQ => 'ChooseColor', //定缺
            SubCmd::SUB_GAME_OUT_CARD_REQ => 'OutCard',         //打牌
            SubCmd::SUB_GAME_CATCH_CARD_REQ => 'CatchCard',     //摸牌
            SubCmd::SUB_GAME_PENG_CARD_REQ => 'PengCard',       //碰牌
            SubCmd::SUB_GAME_GANG_CARD_REQ => 'GangCard',       //杠牌
            SubCmd::SUB_GAME_HU_CARD_REQ => 'HuCard',           //胡牌
            SubCmd::SUB_GAME_CHECK_HU_PENG_GANG => 'CheckHPG',  //检查胡碰杠


            SubCmd::CHAT_MSG_REQ => 'ChatMsg',


            SubCmd::SUB_GAME_PULL => 'GamePull',            //将用户拉进正在进行的游戏房间


            SubCmd::GAME_ROOM_ONE_MORE => 'GameOneMore',
            SubCmd::GAME_TAKE_OVER_USER => 'TakeOverUser',

            SubCmd::GAME_DJS_QUICK => 'GrandMatch',
            SubCmd::GAME_DJS_PULL => 'GrandMatchPull',
        ),
    );
}
